﻿using System.Text.Json;
using Elsa.Expressions.Models;
using Elsa.Expressions.Services;
using Elsa.Extensions;
using Elsa.JavaScript.Contracts;
using Elsa.JavaScript.Models;
using Elsa.Workflows;
using Elsa.Workflows.Attributes;
using Elsa.Workflows.Models;
using Elsa.Workflows.Runtime;
using Elsa.Workflows.Serialization.Serializers;

namespace ElsaDemo
{
    [Activity(Description = "CustomActivity1")]
    public class CustomActivity1 : Activity
    {
        protected async override ValueTask ExecuteAsync(ActivityExecutionContext context)
        {
            var data = JsonSerializer.Serialize(Metadata);
            throw new Exception("主动抛锚");
            //await Console.Out.WriteLineAsync(data);
            await context.CompleteActivityAsync();
            //context.CreateBookmark(new CreateBookmarkArgs
            //{

            //});
        }
    }
}
